Optimal. Leaf size=33 \[ \frac {1}{2} (a+b) x+\frac {(a-b) \cos (c+d x) \sin (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3756, 393, 209}
\begin {gather*} \frac {(a-b) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (a+b) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 393
Rule 3756
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a+b x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {(a-b) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {(a+b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac {1}{2} (a+b) x+\frac {(a-b) \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 32, normalized size = 0.97 \begin {gather*} \frac {2 (a+b) (c+d x)+(a-b) \sin (2 (c+d x))}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 54, normalized size = 1.64
method | result | size |
risch | \(\frac {a x}{2}+\frac {b x}{2}+\frac {\sin \left (2 d x +2 c \right ) a}{4 d}-\frac {\sin \left (2 d x +2 c \right ) b}{4 d}\) | \(40\) |
derivativedivides | \(\frac {b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(54\) |
default | \(\frac {b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(54\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 39, normalized size = 1.18 \begin {gather*} \frac {{\left (d x + c\right )} {\left (a + b\right )} + \frac {{\left (a - b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.85, size = 30, normalized size = 0.91 \begin {gather*} \frac {{\left (a + b\right )} d x + {\left (a - b\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 169 vs.
\(2 (29) = 58\).
time = 0.63, size = 169, normalized size = 5.12 \begin {gather*} \frac {a d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + a d x \tan \left (d x\right )^{2} + b d x \tan \left (d x\right )^{2} + a d x \tan \left (c\right )^{2} + b d x \tan \left (c\right )^{2} - a \tan \left (d x\right )^{2} \tan \left (c\right ) + b \tan \left (d x\right )^{2} \tan \left (c\right ) - a \tan \left (d x\right ) \tan \left (c\right )^{2} + b \tan \left (d x\right ) \tan \left (c\right )^{2} + a d x + b d x + a \tan \left (d x\right ) - b \tan \left (d x\right ) + a \tan \left (c\right ) - b \tan \left (c\right )}{2 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right )^{2} + d \tan \left (c\right )^{2} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.94, size = 32, normalized size = 0.97 \begin {gather*} \frac {\sin \left (2\,c+2\,d\,x\right )\,\left (\frac {a}{4}-\frac {b}{4}\right )+d\,x\,\left (\frac {a}{2}+\frac {b}{2}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________